use chrono::Local;
use serde::{Deserialize, Serialize};
use sqlx::types::chrono::DateTime;
use struct_field_names_as_array::FieldNamesAsSlice;

// 广告位表单数据
#[derive(sqlx::FromRow, Deserialize, Serialize, FieldNamesAsSlice)]
pub struct AdvertPositionForm { 
    // 名称
    pub name: String, 
    // 标识，用于路由
    pub flag: String
}

// 广告位列表行数据
#[derive(sqlx::FromRow, Deserialize, Serialize, FieldNamesAsSlice)]
pub struct AdvertPositionRow { 
    pub id: i64,
    pub name: String, 
    pub flag: String,
    pub created_at: DateTime<Local>,
    pub updated_at: DateTime<Local>
}
